package com.mashibing.service.impl;

import com.mashibing.internalcommon.constant.IdentityConstants;
import com.mashibing.internalcommon.dto.ResponseResult;
import com.mashibing.internalcommon.request.OrderRequest;
import com.mashibing.remote.ServiceOrderClient;
import com.mashibing.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class OrderServiceImpl implements OrderService {

    @Autowired
    private ServiceOrderClient serviceOrderClient;

    @Override
    public ResponseResult addOrder(OrderRequest orderRequest) {
         return serviceOrderClient.addOrder(orderRequest);
    }

    @Override
    public ResponseResult cancel(Long orderId) {
        return serviceOrderClient.cancel(orderId, IdentityConstants.PASSENGER_IDENTITY);
    }
}
